﻿<div class="container padding-10">
    <h3>data-bind方式：</h3>
    <table class="table table-striped">
        <thead>
        <tr>
            <th>SKU</th>
            <th>名称</th>
            <th>单价</th>
        </tr>
        </thead>
        <tbody data-bind="foreach: fruits">
        <tr>
            <td data-bind="text: sku"></td>
            <td data-bind="text: name"></td>
            <td data-bind="text: price"></td>
        </tr>
        </tbody>
    </table>

    <h3>&lt;!--ko foreach--&gt;方式：</h3>
    <table class="table table-striped">
        <thead>
        <tr>
            <th>SKU</th>
            <th>名称</th>
            <th>单价</th>
        </tr>
        </thead>
        <tbody>
        <!--ko foreach: fruits-->
        <tr>
            <td data-bind="text: sku"></td>
            <td data-bind="text: name"></td>
            <td data-bind="text: price"></td>
        </tr>
        <!--/ko-->
        </tbody>
    </table>
</div>

